<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> 
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %> 
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta name="renderer" content="webkit">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>程跟踪页面</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
<div class="Wrapper">
<div class="searchArea">
	<div class="fieldBox" style="display:none;">
		<input name="contractNo" id="contractNo" type="text" class="ui-textbox" value="${contractNo}">
	</div>
</div>
<div id="ligergrid1" class="sq-grid"></div> 
</div>

<script type="text/javascript">
	var grid = null;
	$(function () {
		grid = $("#ligergrid1").ligerGrid({
	    	url: '<%=path%>/archive/arcApplyMain/initFlowList.do?contractNo=${contractNo}',
	    	method : 'get',
	        columns: [
				{ display: '流程编号', name: 'pNo', minWidth: 180 , align:'center', enabledSort:true,
					render: function (rowdata, rowindex, value, column) { 
						var h = '';
						h='<a href="javascript:commShowFlow(';
				        h+="'"+rowdata.pInstId+"',"; //流程实例ID
				        h+="'"+rowdata.audStsCd+"',"; //审核状态
				        h+="'"+rowdata.dataId+"',"; //业务主键ID
				        h+="'"+rowdata.busTyp+"',"; //业务类型
				        h+="'"+rowdata.buOrgCd+"'"; //所属事业部
						h+=')">'+value+'</a>';
						return h;
					}
				},
				//{ display: '流程号', name: 'pInstId', minWidth: 180 , align:'center', enabledSort:true,},
				{ display: '发起人', name: 'crtUsrIdNm', minwidth: 120 , enabledSort:true},
				{ display: '发起时间', name: 'pCrtTm', minWidth: 140 , render:renderDate, enabledSort:false},
				{ display: '状态', name: 'audStsCdNm', minwidth: 120, enabledSort:true,},
	        ],
	        //pageSize:10,
	        usePager:false,
	        root:'rows',
	        record:'total',
	        hideLoadButton : true,
	        width: '100%',
	        height:'100%',
	        heightDiff:-2,
	        checkbox:false,
	        rownumbers:true
	    });
	    grid = liger.get("ligergrid1");
	    grid.setHeight(100);
	    
	
	});
	
	function commShowFlow(pinstId, audStsCd, dataId, busTyp, buOrgCd){
		if(StringUtils.isEmpty(pinstId)){
    		UIUtils.alertWarning(CommonConstant.C_P_INSTANCEID_NOT_HERE);
    		return;
    	}
		var _formUrl = "/archive/arcApplyMain/getFlowNew.do?flag=000@@aid=";
		
    	var params = "?pInsId="+pinstId+"&status="+audStsCd+"&businessKey="+dataId+"&formUrl="+_formUrl;
    	Add_navTab('tab_cst_invoice_flow_'+dataId+pinstId,'查看流程',"<%=path%>/flow/flow/toFlowShowPageFowBus.do"+params);
	}	
	
	//格式化时间
	function renderDate(rowdata, index, value){
		var dateStr = "";
		if(null != value){
			var date = new Date(value);
			dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DDHHMMSS);
		}
		return dateStr;
	}
	
</script>

</body>
</html>